/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package vue;

import modele.Case;
import controleur.PlateauListener;
import java.awt.Graphics;
import javax.swing.JPanel;

/**
 *
 * @author sirine
 */
public class Plateau extends JPanel {
private Case[][] tabCase = new Case[6][7];
private int xp = 50; 
private int yp = 80 ; 

    public int getXp() {
        return xp;
    }

    public void setXp(int xp) {
        this.xp = xp;
    }

    public int getYp() {
        return yp;
    }

    public void setYp(int yp) {
        this.yp = yp;
    }



public Plateau() {
    PlateauListener listener = new PlateauListener(this);
}


    public void paintComponent(Graphics g) {
//dessine le rectangle et les cases 
        
        
        //rectangle : 
        // x1, y1, width, height
        //le plateau de jeu 
        g.drawRect(xp, yp, 410, 365);
        
        //cases : 
        int x = xp+5;
        int y = yp+20;
        int h = 40;
        
        for (int i = 0; i < 7; i++) {
            for (int j = 0; j < 6; j++) {

                Case c = new Case(x, y, h);
                tabCase[j][i]=c;
               c.paintComponent(g);
                //l'espace vertical entre chaque case
                y = y + 60;

            }
            // l'espace horizontale entre chaque case
            x = x + 60;
            y = yp+20;
        }
    }
    
    
    
    
    
}

